<script setup>
import Lang from '@/config/lang'

// 全局初始化 zIndex 的值
const zIndex = 3000
// 全局组件大小 'large' | 'default' | 'small'
const size = ref('small')
// 配置多语言
const locale = shallowRef(Lang['ZhCn'])
// 对按钮进行配置
const button = reactive({
  autoInsertSpace: true
})
// 对消息进行配置
const message = reactive({
  // 最多弹出 3 个消息提示框
  max: 3
})

const setSize = (val) => {
  size.value = val
}

/**
 * App Provide
 */
provide('app_size', { size, setSize })
</script>

<template>
  <!-- https://element-plus.gitee.io/zh-CN/component/config-provider.html -->
  <el-config-provider
    :size="size"
    :z-index="zIndex"
    :locale="locale"
    :button="button"
    :message="message"
  >
    <router-view></router-view>
  </el-config-provider>
</template>

<style lang="scss">
@import url('@/assets/styles/base.scss');
@import url('@/assets/styles/element-plus.scss');
</style>
